/**
 * Sample React Native App
 * https://github.com/facebook/react-native
 * 个人信息
 */
import React, {Component} from "react";
import {
    StyleSheet,
    TouchableOpacity,
    Dimensions,
    Image,
    View,
    ToastAndroid,
    ScrollView,
    Button,
    Text,
    TextInput
} from "react-native";
import color from "../../../widget/color";
import HomeWorkTabBar from "../../../widget/homework/HomeWorkTabBar";
import UnuseCouponScene from "./UnuseCouponScene";
import UsedCouponScene from "./UsedCouponScene";
import OverdueCouponScene from "./OverdueCouponScene";
import ScrollableTabView, {DefaultTabBar, ScrollableTabBar} from "react-native-scrollable-tab-view";
const {width} = Dimensions.get('window')
type Props = {
    navigation: any,
}

type State = {
    typeIndex: number,
    data: Array<Object>,
    refreshState: number,
}
const tabTitles = ['未使用', '已使用', '已过期'];
export default class MineCouponScene extends Component<State,Props> {

    static navigationOptions = ({navigation}: any) => ({

        headerTintColor: 'black',
        title: '优惠券',
        headerStyle: {backgroundColor: 'white'},
        headerRight: <Text/>,
        headerLeft:<TouchableOpacity onPress={()=>{
            navigation.goBack()
        }}>
            <Image style={{marginLeft:12}} source={require('../../../../res/img/gobal_back.png')}/>
        </TouchableOpacity>
    })


    render() {
        return (
            <ScrollableTabView
                tabBarUnderlineStyle={styles.lineStyle}
                renderTabBar={() =>
                <HomeWorkTabBar
                    tabNames={tabTitles}
                        />}
                tabBarPosition='top'>
                <UnuseCouponScene {...this.props}/>
                <UsedCouponScene {...this.props}/>
                <OverdueCouponScene {...this.props}/>
            </ScrollableTabView>
        );
    }

}

const styles = StyleSheet.create({
    container: {
        flex: 1,
    },
    lineStyle: {
        height: 0,
    },

});


